var ns, app, dialog, toast;
var app = new Vue({
    el: '#app',
    data: {
        examType:0,//审核类型 0 物品放行
        IsReject:0,//0 通过  1 拒绝
        ID:0,
        ReleaseExplain:'',//审批意见
    },
    methods: {
        do_save:function(){
            var that=this;
            var options={};
            options.ID = that.ID;
            if(that.IsReject==0){//同意
                options.state=1;
            }
             if(that.IsReject==1){//拒绝
                options.state=2;
            }
            options.ReleaseExplain=that.ReleaseExplain;
            options.action = "savaapproved";
            ns.post(options, function (succeed, data, err) {
                if(succeed){
                    api.toast({
                        msg: '操作成功',
                        duration: 2000,
                        location: 'bottom'
                    });
                }
                else if(err){
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
                setTimeout(function () {
                    //刷新
                    api.sendEvent({
                        name: 'do_load_data',
                    });
                    api.closeWin();
                }, 500);
            });
        },
    }
});
apiready = function () {
    api.parseTapmode();
    ns = window.Foresight.Util;
    dialog = new auiDialog();
    toast = new auiToast();

    app.ID = api.pageParam.ID ;
    app.IsReject = api.pageParam.IsReject ;
    // app.examType = api.pageParam.examType ;
};
